<?php
$submit=array(
    'class'=>'submit',
    'type'=>'submit',
    'value'=>'查询'
);
//班级列表
$classid_options=array();
$classid_options['']='请选择';
foreach($classid as $i) {
    $classid_options[$i->id]=$i->name;
}
?><head>
    <?php $this->load->view('load_view'); ?>
</head>

<div class="col-wrap handin-wrap">
    <!--start col-->
    <div class="col handin">
        <div class="wrap-title">
            <p class="page-title">添加课表</p>
        </div>

        <p class="desc bg">
    	页面提示：在新建一个学期的课表时，一定要有本学期的课程
        </p>
        <div class="itemtitle">
            <h3>操作步骤</h3>
            <?php $this->load->view('admin/sylloptions'); ?>
            <div class="clear"></div>
        </div>
        <div class="search">
            <?php
            echo form_open('admin/syllabus/getsyllabus');
            echo form_label('选择学期');
            echo form_dropdown('year',$year);
            echo form_label('选择班级');
            echo form_dropdown('classid',$classid_options);
            echo form_input($submit);
            echo form_close();
            ?>
        </div>
        <div class="getsyllabus">
            <?php
            if($search==true) {
                echo form_open('admin/syllabus/addsyllabus');
                $tmpl = array (
                    'table_open'          => '<table class="sortTable" cellspacing="1">',
                    'heading_row_start'   => '<thead><tr>',
                    'heading_row_end'     => '</tr></thead>',
                    'heading_cell_start'  => '<th class="header"><p>',
                    'heading_cell_end'    => '</p></th>',
                    'table_close'         => '</table>'
                );
                $this->table->set_template($tmpl);
                $this->table->set_heading('序号','周一','周二','周三','周四','周五');
                echo $this->table->generate($course);
                echo '<div class="search">';
                //学期标识
                $hidden_year=array(
                    'value'=>$currentyear,
                    'type'=>'hidden',
                    'name'=>'currentyear'
                );
                //班级标识
                $hidden_class=array(
                    'value'=>$currentclass,
                    'type'=>'hidden',
                    'name'=>'classid'
                );
                echo form_input($hidden_year);
                echo form_input($hidden_class);
                $submit['value']='提交';
                echo form_input($submit);
                echo '</div>';
            }else {
                ?>
            <p class="desc"><?php echo $info; ?></p>
            <?php } ?>
        </div>
    </div>
    <!--end col-->
</div>
<!--end col-wrap-->
<script>
    $('ul.selectNav li#getsyllabus').addClass('current');
    $(window.parent.document).find("ul.nav li a").removeClass("then");
    $(window.parent.document).find("a#syllabus").attr("class","then");
</script>
